'use strict';

module.exports = app => {
   // 操作日志错误等信息
   app.once('server', server => {
      // websocket
   });
   app.on('error', (err, ctx) => {
      // report error
   });
   app.on('request', ctx => {
      // log receive request
   });
   app.on('response', ctx => {
      // ctx.starttime is set by framework
      const used = Date.now() - ctx.starttime;
      // log total cost
   });
   // 启动自定义,执行后启动项目
   app.beforeStart(async function () {
      //初始化创建表
      await app.model.sync({ force: false });
   });

};
